package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	//var str string
	reader := bufio.NewReader(os.Stdin)
	readString, _ := reader.ReadString('\n')
	//fmt.Scanln(&str)
	//fmt.Println(str, "=====")
	words := reverseWords(readString)
	fmt.Println(words)
}

func reverseWords(s string) string {
	fields := strings.Fields(s)
	fmt.Println(fields)
	var left = 0
	var right = len(fields) - 1
	for left < right {
		fields[left], fields[right] = fields[right], fields[left]
		left++
		right--
	}
	return strings.Join(fields, " ")
}
